
n = 501
m = 50
dp = [[0 for i in xrange(n)] for j in xrange(n)]
dp[0][0] = 1
MAX = 10 ** 6

for i in xrange(1, n):
	dp[i][0] = dp[i-1][0] + dp[i-1][1]
	for b in xrange(50, i + 1):
		dp[i][1] += dp[i - b][0]
	if dp[i][0] + dp[i][1] > MAX:
		print i
		break 

print 'done'
